package com.hui;

import com.sun.tools.javah.LLNI;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.annotation.AfterChunk;
import org.springframework.batch.core.annotation.BeforeChunk;
import org.springframework.batch.core.scope.context.ChunkContext;
import org.springframework.batch.core.scope.context.StepContext;

/**
 * @author zhang zhongtao
 * @version 1.0.0.20191112
 * @since JDK V1.8
 */
@Slf4j
public class MyChunkListener {
    @BeforeChunk
    public void beforeChunk(ChunkContext chunkContext) {
        StepContext stepContext = chunkContext.getStepContext();
        log.info("\n\rMyChunkListener.beforeChunk Job:{}, step:{}", stepContext.getJobName(), stepContext.getStepName());
    }

    @AfterChunk
    public void afterChunk(ChunkContext chunkContext) {
        StepContext stepContext = chunkContext.getStepContext();
        log.info("\n\rMyChunkListener.afterChunk Job:{}, step:{}", stepContext.getJobName(), stepContext.getStepName());
    }

}
